GXTouchesBoundsShape
You can use theGXTouchesBoundsShape
function to determine if a rectangle and a shape touch.
gxBoolean GXTouchesBoundsShape(const gxRectangle *target, gxShape test);
target
- A pointer to the rectangle to test to determine if it touches a shape.
test
- A reference to the shape to test to determine if it touches the rectangle.
- function result
- A Boolean value indicating whether the shape touches the rectangle.
DESCRIPTION
TheGXTouchesBoundsShape
function returnstrue
as its function result if the rectangle specified by thetarget
parameter touches the shape specified by thetest
parameter--even if they share only an edge or a point--and returnsfalse
otherwise.This function considers the shape fill, the style modifications, and the transform mapping of the test shape. Only areas that are drawn are considered when determining touching.
If you provide a test shape that is not one of the geometric shape types, this function performs the actions described in the following table:
Shape type Action taken bitmap Compares bounding rectangle of bitmap picture Posts the error illegal_type_for_shape
text Converts to path shape glyph Converts to path shape layout Converts to path shape ERRORS, WARNINGS, AND NOTICES
Errors out_of_memory shape_is_nil parameter_is_nil (debugging version) illegal_type_for_shape (debugging version) shape_may_not_be_a_picture (debugging version) SEE ALSO
For an example using this function, see "Determining Whether Two Shapes Touch" beginning on page 4-53.For a discussion of shape fills, see Chapter 2, "Geometric Shapes," in this book.
For a discussion of style modifications, see Chapter 3, "Geometric Styles," in this book.
For a discussion of transform mappings, see the chapter "Transform Objects" in Inside Macintosh: QuickDraw GX Objects.
To determine if a rectangle touches a point, use the
GXTouchesRectanglePoint
function, described on page 4-96.To determine if a rectangle contains a shape, use the
GXContainsBoundsShape
function, described on page 4-101.To determine if two shapes touch, use the
GXTouchesShape
function, described in the next section.
Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help